<div class="widgets">
    <ba-card title="">
        <div class="form col-sm-11">
            <div class="form-group row">
                <div class="col-sm-6">
                    <div class="input-group">
                        <span class="input-group-addon" id="sizing-addon2"><i class="fa fa-search"></i>搜索</span>
                        <input type="text" class="form-control" placeholder="search" aria-describedby="sizing-addon2" [(ngModel)]="searchText">
                    </div>
                </div>
            </div>
        </div>

        <div>
            <button class="btn btn-primary" (click)="onNew()">新增</button>
        </div>
    </ba-card>

    <ba-card title="">
        <trip-detail [trip]="selectedTrip" (onVoted)="getTrips()" ></trip-detail>
    </ba-card>

    <ba-card title="路线列表">
        <table class="table table-bordered table-hover">
            <thead>
                <th>路线ID</th>
                <th>路线名称</th>
                <th>发车时间</th>
                <th>所属公司</th>
                <th>司机姓名</th>
                <th>司机电话</th>
                <th>车牌号</th>
                <th>票价</th>
                <th>站点明细</th>
            </thead>
            <tbody>
                <tr *ngFor="let trip of trips" [class.selected]="trip === selectedTrip" (click)="onSelect(trip)">
                    <td>
                        <span class="badge">{{trip.trip_id}}</span></td>
                    <td>{{trip.trip_name}} </td>
                    <td>{{trip.trip_time}}</td>
                    <td>{{trip.carrier_name}} </td>
                    <td>{{trip.driver_name}} </td>
                    <td>{{trip.driver_mobile}}</td>
                    <td>{{trip.plate_number}} </td>
                    <td>{{trip.price}}</td>
                    <td><a class="btn btn-info btn-with-icon" [routerLink]="['./stop']" [queryParams]="{trip_id: trip.trip_id}">站点明细</a>
                    </td>
                </tr>
            </tbody>
        </table>
   </ba-card>
</div>
